package com.min.lib_record;


import android.annotation.SuppressLint;
import android.content.Context;

import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.schedulers.Schedulers;

/**
 * log记录实际操作类
 * <p>利用Rxjava的操作实现事件记录，{@code Observable.create()}在子线程里操作数据写入</p>
 */
public class LogRecorder {

    private static final String LOG_FILE_PATH = "";
    private static final LogRecorder INSTANCE = new LogRecorder();

    private Context context;

    private LogRecorder() {
    }

    public static LogRecorder getInstance() {
        return INSTANCE;
    }

    @SuppressLint("checkResult")
    public void recordLog() {
        Observable.create(new ObservableOnSubscribe<Object>() {
            @Override
            public void subscribe(ObservableEmitter<Object> emitter) throws Exception {

            }
        })
                .subscribeOn(Schedulers.io())
                .subscribe();
    }

    public void setContext(Context context) {
        this.context = context;
    }
}
